//
//  XhwMSCtrl.m
//  SelfDriving
//
//  Created by 熊宏伟 on 2018/3/15.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "XhwMSCtrl.h"

@interface XhwMSCtrl ()

@end

@implementation XhwMSCtrl

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

-(void)toRootViewController{
    UIViewController *viewController = self;
    while (viewController.presentingViewController) {
        //判断是否为最底层控制器
        if ([viewController isKindOfClass:[XhwMSCtrl class]]) {
            viewController = viewController.presentingViewController;
        }else{
            break;
        }
    }
    if (viewController) {
        [viewController dismissViewControllerAnimated:YES completion:nil];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
